package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.sql.Time;
import java.util.Objects;

@Entity
public class Solicitude {
    private long solicitudeId;
    private String solicitudeDemand;
    private Time solicitudeDate;
    private String solicitudeFeedback;
    private Customer customerByCustomerId;

    @Id
    @Column(name = "solicitude_id")
    public long getSolicitudeId() {
        return solicitudeId;
    }

    public void setSolicitudeId(long solicitudeId) {
        this.solicitudeId = solicitudeId;
    }

    @Basic
    @Column(name = "solicitude_demand")
    public String getSolicitudeDemand() {
        return solicitudeDemand;
    }

    public void setSolicitudeDemand(String solicitudeDemand) {
        this.solicitudeDemand = solicitudeDemand;
    }

    @Basic
    @Column(name = "solicitude_date")
    public Time getSolicitudeDate() {
        return solicitudeDate;
    }

    public void setSolicitudeDate(Time solicitudeDate) {
        this.solicitudeDate = solicitudeDate;
    }

    @Basic
    @Column(name = "solicitude_feedback")
    public String getSolicitudeFeedback() {
        return solicitudeFeedback;
    }

    public void setSolicitudeFeedback(String solicitudeFeedback) {
        this.solicitudeFeedback = solicitudeFeedback;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Solicitude that = (Solicitude) o;
        return solicitudeId == that.solicitudeId &&
                Objects.equals(solicitudeDemand, that.solicitudeDemand) &&
                Objects.equals(solicitudeDate, that.solicitudeDate) &&
                Objects.equals(solicitudeFeedback, that.solicitudeFeedback);
    }

    @Override
    public int hashCode() {
        return Objects.hash(solicitudeId, solicitudeDemand, solicitudeDate, solicitudeFeedback);
    }

    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }
}
